import { Component, OnInit, ViewChild } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { SFSchema, SFComponent } from '@delon/form';
import { GridComponent, HttpService, SupDic } from 'lbf';
import { NzMessageService } from 'ng-zorro-antd';
import { STColumn } from '@delon/abc';

@Component({
  selector: 'app-xtgn-bkgl',
  templateUrl: './bkgl.component.html',
})
export class XtgnBkglComponent implements OnInit {

  isBkVisible = false;
  isUpVisible = false;

  param = {sname: 'bkgl_bkcx',queryparas: {}}

  constructor(private http: HttpService,
              private msgSrv: NzMessageService,
              private supdic: SupDic
    ) { }

  newBkSchema: SFSchema = {
    properties:{

    }
  }

  updateBkSchema: SFSchema = {
    properties:{

    }
  }

  searchSchema: SFSchema = {

  }

  columns: STColumn[] = [
    {title: '1',index: '1'},
    {
      title: '操作区',
      buttons : [
        {
          text: '修改',
          click: (record) =>this.update(record)
        },
        {
          text: '删除',
          pop: true,
          click: (record) => this.del(record)
        }
      ]
    }
  ]

  @ViewChild('addsf',{static: false}) addsf :SFComponent;
  @ViewChild('upsf',{static: false}) upsf: SFComponent;
  @ViewChild('sf',{static: false}) sf: SFComponent;
  @ViewChild('st',{static: false}) st: GridComponent;
  ngOnInit() { }

  add(){
    this.isBkVisible = true;
  }

  query(){
    
  }

  update(record){
    this.isUpVisible =  true;
  }

  del(record){

  }

  handleCancel(){
    this.isBkVisible = false;
    this.isUpVisible = false;
  }

  saveAdd(data){
    this.isBkVisible = false;
  }

  saveUp(data){
    this.isUpVisible = false;
  }

}
